<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>vue 10</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">{{msg}}
        <div id="exp">
            <button v-on:click="count++">add: {{count}}</button>
            <button @dblclick="handler('arg', $event)">双击弹窗</button>
            <p>Original message: "{{ msg }}"</p>
            <p>Computed reversed message: "{{ reversedMsg }}"</p>
        </div>


    </div>
    <script text="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                msg: "I am coming!",
                count: 0,
            },
            methods: {
                handler(arg, $event) {
                    alert(arg + "|" + this.count);
                },
            },
            computed: {
                reversedMsg() {
                    return this.msg.split('').reverse().join('')
                },
            },
        });
    </script>
</body>